home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / ColorSync 2.6 Mac SDK / Interfaces / CMICCProfile.p < prev    next >
Encoding:
Text File  |  1999-05-07  |  27.7 KB  |  844 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CMICCProfile.p
  3.  
  4.      Contains:    ICC Profile Format Definitions
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    ColorSync 2.6 SDK for use with Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT CMICCProfile;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __CMICCPROFILE__}
  27. {$SETC __CMICCPROFILE__ := 1}
  28.  
  29. {$I+}
  30. {$SETC CMICCProfileIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36.  
  37.  
  38. {$PUSH}
  39. {$ALIGN MAC68K}
  40. {$LibExport+}
  41.  
  42. { ICC Profile version constants  }
  43.  
  44. CONST
  45.     cmICCProfileVersion2        = $02000000;
  46.     cmICCProfileVersion21        = $02100000;
  47.     cmCS2ProfileVersion            = $02000000;
  48.     cmCS1ProfileVersion            = $00000100;                    {  ColorSync 1.0 profile version  }
  49.  
  50. { Current Major version number }
  51.     cmProfileMajorVersionMask    = $FF000000;
  52.     cmCurrentProfileMajorVersion = $02000000;
  53.  
  54. { magic cookie number for anonymous file ID }
  55.     cmMagicNumber                = 'acsp';
  56.  
  57.  
  58. {**********************************************************************}
  59. {************** ColorSync 2.0 profile specification *******************}
  60. {**********************************************************************}
  61. {*** flags field  ***}
  62.     cmICCReservedFlagsMask        = $0000FFFF;                    {  these bits of the flags field are defined and reserved by ICC  }
  63.     cmEmbeddedMask                = $00000001;                    {  if bit 0 is 0 then not embedded profile, if 1 then embedded profile  }
  64.     cmEmbeddedUseMask            = $00000002;                    {  if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only  }
  65.     cmCMSReservedFlagsMask        = $FFFF0000;                    {  these bits of the flags field are defined and reserved by CMS vendor  }
  66.     cmQualityMask                = $00030000;                    {  if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best  }
  67.     cmInterpolationMask            = $00040000;                    {  if bit 18 is 0 then interpolation, if 1 then lookup only  }
  68.     cmGamutCheckingMask            = $00080000;                    {  if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info  }
  69.  
  70. { copyright-protection flag options }
  71.     cmEmbeddedProfile            = 0;                            {  0 is not embedded profile, 1 is embedded profile  }
  72.     cmEmbeddedUse                = 1;                            {  0 is to use anywhere, 1 is to use as embedded profile only  }
  73.  
  74. { speed and quality flag options }
  75.     cmNormalMode                = 0;                            {  it uses the least significent two bits in the high word of flag  }
  76.     cmDraftMode                    = 1;                            {  it should be evaulated like this: right shift 16 bits first, mask off the  }
  77.     cmBestMode                    = 2;                            {  high 14 bits, and then compare with the enum to determine the option value  }
  78.  
  79.  
  80. {*** deviceAttributes fields ***}
  81. { deviceAttributes[0] is defined by and reserved for device vendors }
  82. { deviceAttributes[1] is defined by and reserved for ICC }
  83. { The following bits of deviceAttributes[1] are currently defined }
  84.     cmReflectiveTransparentMask    = $00000001;                    {  if bit 0 is 0 then reflective media, if 1 then transparency media  }
  85.     cmGlossyMatteMask            = $00000002;                    {  if bit 1 is 0 then glossy, if 1 then matte  }
  86.  
  87. { device/media attributes element values  }
  88.     cmReflective                = 0;                            {  if bit 0 is 0 then reflective media, if 1 then transparency media  }
  89.     cmGlossy                    = 1;                            {  if bit 1 is 0 then glossy, if 1 then matte  }
  90.  
  91.  
  92. {*** renderingIntent field ***}
  93.     cmPerceptual                = 0;                            {  Photographic images  }
  94.     cmRelativeColorimetric        = 1;                            {  Logo Colors  }
  95.     cmSaturation                = 2;                            {  Business graphics  }
  96.     cmAbsoluteColorimetric        = 3;                            {  Logo Colors  }
  97.  
  98.  
  99.  
  100. { data type element values }
  101.     cmAsciiData                    = 0;
  102.     cmBinaryData                = 1;
  103.  
  104. { screen encodings  }
  105.     cmPrtrDefaultScreens        = 0;                            {  Use printer default screens.  0 is false, 1 is ture  }
  106.     cmLinesPer                    = 1;                            {  0 is LinesPerCm, 1 is LinesPerInch  }
  107.  
  108. { 2.0 tag type information }
  109.     cmNumHeaderElements            = 10;
  110.  
  111. { public tags }
  112.     cmAToB0Tag                    = 'A2B0';
  113.     cmAToB1Tag                    = 'A2B1';
  114.     cmAToB2Tag                    = 'A2B2';
  115.     cmBlueColorantTag            = 'bXYZ';
  116.     cmBlueTRCTag                = 'bTRC';
  117.     cmBToA0Tag                    = 'B2A0';
  118.     cmBToA1Tag                    = 'B2A1';
  119.     cmBToA2Tag                    = 'B2A2';
  120.     cmCalibrationDateTimeTag    = 'calt';
  121.     cmCharTargetTag                = 'targ';
  122.     cmCopyrightTag                = 'cprt';
  123.     cmDeviceMfgDescTag            = 'dmnd';
  124.     cmDeviceModelDescTag        = 'dmdd';
  125.     cmGamutTag                    = 'gamt';
  126.     cmGrayTRCTag                = 'kTRC';
  127.     cmGreenColorantTag            = 'gXYZ';
  128.     cmGreenTRCTag                = 'gTRC';
  129.     cmLuminanceTag                = 'lumi';
  130.     cmMeasurementTag            = 'meas';
  131.     cmMediaBlackPointTag        = 'bkpt';
  132.     cmMediaWhitePointTag        = 'wtpt';
  133.     cmNamedColorTag                = 'ncol';
  134.     cmNamedColor2Tag            = 'ncl2';
  135.     cmPreview0Tag                = 'pre0';
  136.     cmPreview1Tag                = 'pre1';
  137.     cmPreview2Tag                = 'pre2';
  138.     cmProfileDescriptionTag        = 'desc';
  139.     cmProfileSequenceDescTag    = 'pseq';
  140.     cmPS2CRD0Tag                = 'psd0';
  141.     cmPS2CRD1Tag                = 'psd1';
  142.     cmPS2CRD2Tag                = 'psd2';
  143.     cmPS2CRD3Tag                = 'psd3';
  144.     cmPS2CSATag                    = 'ps2s';
  145.     cmPS2RenderingIntentTag        = 'ps2i';
  146.     cmRedColorantTag            = 'rXYZ';
  147.     cmRedTRCTag                    = 'rTRC';
  148.     cmScreeningDescTag            = 'scrd';
  149.     cmScreeningTag                = 'scrn';
  150.     cmTechnologyTag                = 'tech';
  151.     cmUcrBgTag                    = 'bfd ';
  152.     cmViewingConditionsDescTag    = 'vued';
  153.     cmViewingConditionsTag        = 'view';
  154.  
  155. { custom tags }
  156.     cmPS2CRDVMSizeTag            = 'psvm';
  157.     cmVideoCardGammaTag            = 'vcgt';
  158.     cmMakeAndModelTag            = 'mmod';
  159.  
  160. { technology tag descriptions }
  161.     cmTechnologyFilmScanner        = 'fscn';
  162.     cmTechnologyReflectiveScanner = 'rscn';
  163.     cmTechnologyInkJetPrinter    = 'ijet';
  164.     cmTechnologyThermalWaxPrinter = 'twax';
  165.     cmTechnologyElectrophotographicPrinter = 'epho';
  166.     cmTechnologyElectrostaticPrinter = 'esta';
  167.     cmTechnologyDyeSublimationPrinter = 'dsub';
  168.     cmTechnologyPhotographicPaperPrinter = 'rpho';
  169.     cmTechnologyFilmWriter        = 'fprn';
  170.     cmTechnologyVideoMonitor    = 'vidm';
  171.     cmTechnologyVideoCamera        = 'vidc';
  172.     cmTechnologyProjectionTelevision = 'pjtv';
  173.     cmTechnologyCRTDisplay        = 'CRT ';
  174.     cmTechnologyPMDisplay        = 'PMD ';
  175.     cmTechnologyAMDisplay        = 'AMD ';
  176.     cmTechnologyPhotoCD            = 'KPCD';
  177.     cmTechnologyPhotoImageSetter = 'imgs';
  178.     cmTechnologyGravure            = 'grav';
  179.     cmTechnologyOffsetLithography = 'offs';
  180.     cmTechnologySilkscreen        = 'silk';
  181.     cmTechnologyFlexography        = 'flex';
  182.  
  183. { public type signatures }
  184.     cmSigCurveType                = 'curv';
  185.     cmSigDataType                = 'data';
  186.     cmSigDateTimeType            = 'dtim';
  187.     cmSigLut16Type                = 'mft2';
  188.     cmSigLut8Type                = 'mft1';
  189.     cmSigMeasurementType        = 'meas';
  190.     cmSigNamedColorType            = 'ncol';
  191.     cmSigNamedColor2Type        = 'ncl2';
  192.     cmSigProfileDescriptionType    = 'desc';
  193.     cmSigScreeningType            = 'scrn';
  194.     cmSigS15Fixed16Type            = 'sf32';
  195.     cmSigSignatureType            = 'sig ';
  196.     cmSigTextType                = 'text';
  197.     cmSigU16Fixed16Type            = 'uf32';
  198.     cmSigU1Fixed15Type            = 'uf16';
  199.     cmSigUInt32Type                = 'ui32';
  200.     cmSigUInt64Type                = 'ui64';
  201.     cmSigUInt8Type                = 'ui08';
  202.     cmSigViewingConditionsType    = 'view';
  203.     cmSigXYZType                = 'XYZ ';
  204.  
  205. { custom type signatures }
  206.     cmSigVideoCardGammaType        = 'vcgt';
  207.     cmSigMakeAndModelType        = 'mmod';
  208.  
  209.  
  210. { Measurement type encodings }
  211. { Measurement Flare }
  212.     cmFlare0                    = $00000000;
  213.     cmFlare100                    = $00000001;
  214.  
  215. { Measurement Geometry    }
  216.     cmGeometryUnknown            = $00000000;
  217.     cmGeometry045or450            = $00000001;
  218.     cmGeometry0dord0            = $00000002;
  219.  
  220. { Standard Observer    }
  221.     cmStdobsUnknown                = $00000000;
  222.     cmStdobs1931TwoDegrees        = $00000001;
  223.     cmStdobs1964TenDegrees        = $00000002;
  224.  
  225. { Standard Illuminant }
  226.     cmIlluminantUnknown            = $00000000;
  227.     cmIlluminantD50                = $00000001;
  228.     cmIlluminantD65                = $00000002;
  229.     cmIlluminantD93                = $00000003;
  230.     cmIlluminantF2                = $00000004;
  231.     cmIlluminantD55                = $00000005;
  232.     cmIlluminantA                = $00000006;
  233.     cmIlluminantEquiPower        = $00000007;
  234.     cmIlluminantF8                = $00000008;
  235.  
  236. { Spot Function Value }
  237.     cmSpotFunctionUnknown        = 0;
  238.     cmSpotFunctionDefault        = 1;
  239.     cmSpotFunctionRound            = 2;
  240.     cmSpotFunctionDiamond        = 3;
  241.     cmSpotFunctionEllipse        = 4;
  242.     cmSpotFunctionLine            = 5;
  243.     cmSpotFunctionSquare        = 6;
  244.     cmSpotFunctionCross            = 7;
  245.  
  246. { Color Space Signatures }
  247.     cmXYZData                    = 'XYZ ';
  248.     cmLabData                    = 'Lab ';
  249.     cmLuvData                    = 'Luv ';
  250.     cmYxyData                    = 'Yxy ';
  251.     cmRGBData                    = 'RGB ';
  252.     cmGrayData                    = 'GRAY';
  253.     cmHSVData                    = 'HSV ';
  254.     cmHLSData                    = 'HLS ';
  255.     cmCMYKData                    = 'CMYK';
  256.     cmCMYData                    = 'CMY ';
  257.     cmMCH5Data                    = 'MCH5';
  258.     cmMCH6Data                    = 'MCH6';
  259.     cmMCH7Data                    = 'MCH7';
  260.     cmMCH8Data                    = 'MCH8';
  261.     cm3CLRData                    = '3CLR';
  262.     cm4CLRData                    = '4CLR';
  263.     cm5CLRData                    = '5CLR';
  264.     cm6CLRData                    = '6CLR';
  265.     cm7CLRData                    = '7CLR';
  266.     cm8CLRData                    = '8CLR';
  267.     cmNamedData                    = 'NAME';
  268.  
  269. { profileClass enumerations }
  270.     cmInputClass                = 'scnr';
  271.     cmDisplayClass                = 'mntr';
  272.     cmOutputClass                = 'prtr';
  273.     cmLinkClass                    = 'link';
  274.     cmAbstractClass                = 'abst';
  275.     cmColorSpaceClass            = 'spac';
  276.     cmNamedColorClass            = 'nmcl';
  277.  
  278. { platform enumerations }
  279.     cmMacintosh                    = 'APPL';
  280.     cmMicrosoft                    = 'MSFT';
  281.     cmSolaris                    = 'SUNW';
  282.     cmSiliconGraphics            = 'SGI ';
  283.     cmTaligent                    = 'TGNT';
  284.  
  285. { ColorSync 1.0 elements }
  286.     cmCS1ChromTag                = 'chrm';
  287.     cmCS1TRCTag                    = 'trc ';
  288.     cmCS1NameTag                = 'name';
  289.     cmCS1CustTag                = 'cust';
  290.  
  291. { General element data types }
  292.  
  293. TYPE
  294.     CMDateTimePtr = ^CMDateTime;
  295.     CMDateTime = RECORD
  296.         year:                    UInt16;
  297.         month:                    UInt16;
  298.         dayOfTheMonth:            UInt16;
  299.         hours:                    UInt16;
  300.         minutes:                UInt16;
  301.         seconds:                UInt16;
  302.     END;
  303.  
  304.     CMFixedXYZColorPtr = ^CMFixedXYZColor;
  305.     CMFixedXYZColor = RECORD
  306.         X:                        Fixed;
  307.         Y:                        Fixed;
  308.         Z:                        Fixed;
  309.     END;
  310.  
  311.     CMXYZComponent                        = UInt16;
  312.     CMXYZColorPtr = ^CMXYZColor;
  313.     CMXYZColor = RECORD
  314.         X:                        CMXYZComponent;
  315.         Y:                        CMXYZComponent;
  316.         Z:                        CMXYZComponent;
  317.     END;
  318.  
  319.     CM2HeaderPtr = ^CM2Header;
  320.     CM2Header = RECORD
  321.         size:                    UInt32;                                    {  This is the total size of the Profile  }
  322.         CMMType:                OSType;                                    {  CMM signature,  Registered with CS2 consortium   }
  323.         profileVersion:            UInt32;                                    {  Version of CMProfile format  }
  324.         profileClass:            OSType;                                    {  input, display, output, devicelink, abstract, or color conversion profile type  }
  325.         dataColorSpace:            OSType;                                    {  color space of data  }
  326.         profileConnectionSpace:    OSType;                                    {  profile connection color space  }
  327.         dateTime:                CMDateTime;                                {  date and time of profile creation  }
  328.         CS2profileSignature:    OSType;                                    {  'acsp' constant ColorSync 2.0 file ID  }
  329.         platform:                OSType;                                    {  primary profile platform, Registered with CS2 consortium  }
  330.         flags:                    UInt32;                                    {  profile flags  }
  331.         deviceManufacturer:        OSType;                                    {  Registered with ICC consortium  }
  332.         deviceModel:            UInt32;                                    {  Registered with ICC consortium  }
  333.         deviceAttributes:        ARRAY [0..1] OF UInt32;                    {  Attributes[0] is for device vendors, [1] is for ICC  }
  334.         renderingIntent:        UInt32;                                    {  preferred rendering intent of tagged object  }
  335.         white:                    CMFixedXYZColor;                        {  profile illuminant  }
  336.         creator:                OSType;                                    {  profile creator  }
  337.         reserved:                PACKED ARRAY [0..43] OF CHAR;            {  reserved for future use  }
  338.     END;
  339.  
  340.     CMTagRecordPtr = ^CMTagRecord;
  341.     CMTagRecord = RECORD
  342.         tag:                    OSType;                                    {  Registered with CS2 consortium  }
  343.         elementOffset:            UInt32;                                    {  Relative to start of CMProfile  }
  344.         elementSize:            UInt32;
  345.     END;
  346.  
  347.     CMTagElemTablePtr = ^CMTagElemTable;
  348.     CMTagElemTable = RECORD
  349.         count:                    UInt32;
  350.         tagList:                ARRAY [0..0] OF CMTagRecord;            {  Variable size  }
  351.     END;
  352.  
  353. { External 0x02002001 CMProfile }
  354.     CM2ProfilePtr = ^CM2Profile;
  355.     CM2Profile = RECORD
  356.         header:                    CM2Header;
  357.         tagTable:                CMTagElemTable;
  358.         elemData:                SInt8;                                    {  Tagged element storage. Variable size  }
  359.     END;
  360.  
  361.     CM2ProfileHandle                    = ^CM2ProfilePtr;
  362. { Tag Type Definitions }
  363.     CMCurveTypePtr = ^CMCurveType;
  364.     CMCurveType = RECORD
  365.         typeDescriptor:            OSType;                                    {  'curv'  }
  366.         reserved:                UInt32;                                    {  fill with 0x00  }
  367.         countValue:                UInt32;                                    {  number of entries in table that follows  }
  368.         data:                    ARRAY [0..0] OF UInt16;                    {  Tagged element storage. Variable size  }
  369.     END;
  370.  
  371.     CMDataTypePtr = ^CMDataType;
  372.     CMDataType = RECORD
  373.         typeDescriptor:            OSType;                                    {  'data'  }
  374.         reserved:                UInt32;                                    {  fill with 0x00  }
  375.         dataFlag:                UInt32;                                    {  0 = ASCII, 1 = binary  }
  376.         data:                    SInt8;                                    {  Tagged element storage. Variable size  }
  377.     END;
  378.  
  379.     CMDateTimeTypePtr = ^CMDateTimeType;
  380.     CMDateTimeType = RECORD
  381.         typeDescriptor:            OSType;                                    {  'dtim'  }
  382.         reserved:                UInt32;
  383.         dateTime:                CMDateTime;
  384.     END;
  385.  
  386.     CMLut16TypePtr = ^CMLut16Type;
  387.     CMLut16Type = RECORD
  388.         typeDescriptor:            OSType;                                    {  'mft2'  }
  389.         reserved:                UInt32;                                    {  fill with 0x00  }
  390.         inputChannels:            SInt8;                                    {  Number of input channels  }
  391.         outputChannels:            SInt8;                                    {  Number of output channels  }
  392.         gridPoints:                SInt8;                                    {  Number of clutTable grid points  }
  393.         reserved2:                SInt8;                                    {  fill with 0x00  }
  394.         matrix:                    ARRAY [0..2,0..2] OF Fixed;                {   }
  395.         inputTableEntries:        UInt16;                                    {   }
  396.         outputTableEntries:        UInt16;                                    {   }
  397.         inputTable:                ARRAY [0..0] OF UInt16;                    {  Variable size  }
  398.         CLUT:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  399.         outputTable:            ARRAY [0..0] OF UInt16;                    {  Variable size  }
  400.     END;
  401.  
  402.     CMLut8TypePtr = ^CMLut8Type;
  403.     CMLut8Type = RECORD
  404.         typeDescriptor:            OSType;                                    {  'mft1'  }
  405.         reserved:                UInt32;                                    {  fill with 0x00  }
  406.         inputChannels:            SInt8;                                    {   }
  407.         outputChannels:            SInt8;                                    {   }
  408.         gridPoints:                SInt8;                                    {   }
  409.         reserved2:                SInt8;                                    {  fill with 0x00  }
  410.         matrix:                    ARRAY [0..2,0..2] OF Fixed;                {   }
  411.         inputTable:                PACKED ARRAY [0..255] OF UInt8;            {  fixed size of 256  }
  412.         CLUT:                    PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  413.         outputTable:            PACKED ARRAY [0..255] OF UInt8;            {  fixed size of 256  }
  414.     END;
  415.  
  416.     CMMeasurementTypePtr = ^CMMeasurementType;
  417.     CMMeasurementType = RECORD
  418.         typeDescriptor:            OSType;                                    {  'meas'  }
  419.         reserved:                UInt32;                                    {  fill with 0x00  }
  420.         standardObserver:        UInt32;                                    {  0 : unknown, 1 : CIE 1931, 2 : CIE 1964  }
  421.         backingXYZ:                CMFixedXYZColor;                        {  absolute XYZ values of backing  }
  422.         geometry:                UInt32;                                    {  0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0  }
  423.         flare:                    UInt32;                                    {  0 : 0%, 1 : 100% flare  }
  424.         illuminant:                UInt32;                                    {  standard illuminant  }
  425.     END;
  426.  
  427.     CMNamedColorTypePtr = ^CMNamedColorType;
  428.     CMNamedColorType = RECORD
  429.         typeDescriptor:            OSType;                                    {  'ncol'  }
  430.         reserved:                UInt32;                                    {  fill with 0x00  }
  431.         vendorFlag:                UInt32;                                    {   }
  432.         count:                    UInt32;                                    {  count of named colors in array that follows  }
  433.         prefixName:                SInt8;                                    {  Variable size, max = 32, to access fields after this one, have to count bytes  }
  434.         suffixName:                SInt8;                                    {  Variable size, max = 32  }
  435.         data:                    SInt8;                                    {  varaible size data as explained below  }
  436.     END;
  437.  
  438. {    
  439.     A variable size array of structs appears as the last block of data
  440.     in the above struct, CMNamedColorType.  The data structure
  441.     is as follows: (example in C)
  442.     
  443.     struct (                                             
  444.         unsigned char    rootName[1];                 * Variable size, max = 32 
  445.         unsigned char    colorCoords[1];                 * Variable size  
  446.     ) colorName[1];                                     * Variable size  
  447. }
  448.     CMNamedColor2TypePtr = ^CMNamedColor2Type;
  449.     CMNamedColor2Type = RECORD
  450.         typeDescriptor:            OSType;                                    {  'ncl2'  }
  451.         reserved:                UInt32;                                    {  fill with 0x00  }
  452.         vendorFlag:                UInt32;                                    {  lower 16 bits reserved for ICC use  }
  453.         count:                    UInt32;                                    {  count of named colors in array that follows  }
  454.         deviceChannelCount:        UInt32;                                    {  number of device channels, 0 indicates no device value available  }
  455.         prefixName:                PACKED ARRAY [0..31] OF UInt8;            {  32 byte field.  7 bit ASCII null terminated  }
  456.         suffixName:                PACKED ARRAY [0..31] OF UInt8;            {  32 byte field.  7 bit ASCII null terminated  }
  457.         data:                    SInt8;                                    {  varaible size data as definced below  }
  458.     END;
  459.  
  460.     CMNamedColor2EntryTypePtr = ^CMNamedColor2EntryType;
  461.     CMNamedColor2EntryType = RECORD
  462.         rootName:                PACKED ARRAY [0..31] OF UInt8;            {  32 byte field.  7 bit ASCII null terminated  }
  463.         PCSColorCoords:            ARRAY [0..2] OF UInt16;                    {  Lab or XYZ color  }
  464.         DeviceColorCoords:        ARRAY [0..0] OF UInt16;                    {  Variable size  }
  465.     END;
  466.  
  467.     CMTextDescriptionTypePtr = ^CMTextDescriptionType;
  468.     CMTextDescriptionType = PACKED RECORD
  469.         typeDescriptor:            OSType;                                    {  'desc'  }
  470.         reserved:                UInt32;                                    {  fill with 0x00  }
  471.         ASCIICount:                UInt32;                                    {  the count of "bytes"  }
  472.         ASCIIName:                PACKED ARRAY [0..1] OF UInt8;            {  Variable size, to access fields after this one, have to count bytes  }
  473.         UniCodeCode:            UInt32;
  474.         UniCodeCount:            UInt32;                                    {  the count of characters, each character has two bytes  }
  475.         UniCodeName:            PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  476.         ScriptCodeCode:            INTEGER;
  477.         ScriptCodeCount:        UInt8;                                    {  the count of "bytes"  }
  478.         ScriptCodeName:            PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  479.     END;
  480.  
  481.     CMTextTypePtr = ^CMTextType;
  482.     CMTextType = RECORD
  483.         typeDescriptor:            OSType;                                    {  'text'  }
  484.         reserved:                UInt32;                                    {  fill with 0x00  }
  485.         text:                    SInt8;                                    {  count of text is obtained from tag size element  }
  486.     END;
  487.  
  488.     CMScreeningTypePtr = ^CMScreeningType;
  489.     CMScreeningType = RECORD
  490.         typeDescriptor:            OSType;                                    {  'scrn'  }
  491.         reserved:                UInt32;                                    {  fill with 0x00  }
  492.         screeningFlag:            UInt32;                                    {  bit 0 : use printer default screens, bit 1 : inch/cm  }
  493.         channelCount:            UInt32;
  494.         data:                    SInt8;                                    {  varaible size data as explained below  }
  495.     END;
  496.  
  497. {
  498.     A variable size array of structs appears as the last block of data
  499.     in the above struct, CMScreeningType.  The data structure
  500.     is as follows: (example in C)
  501.     
  502.     struct (
  503.         Fixed            frequency;
  504.         Fixed            angle;
  505.         unsigned long    sportFunction;
  506.      )    channelScreening[1];                        * Variable size 
  507. }
  508.     CMSignatureTypePtr = ^CMSignatureType;
  509.     CMSignatureType = RECORD
  510.         typeDescriptor:            OSType;                                    {  'sig '  }
  511.         reserved:                UInt32;                                    {  fill with 0x00  }
  512.         signature:                OSType;
  513.     END;
  514.  
  515.     CMS15Fixed16ArrayTypePtr = ^CMS15Fixed16ArrayType;
  516.     CMS15Fixed16ArrayType = RECORD
  517.         typeDescriptor:            OSType;                                    {  'sf32'  }
  518.         reserved:                UInt32;                                    {  fill with 0x00  }
  519.         value:                    ARRAY [0..0] OF Fixed;                    {  Variable size  }
  520.     END;
  521.  
  522.     CMU16Fixed16ArrayTypePtr = ^CMU16Fixed16ArrayType;
  523.     CMU16Fixed16ArrayType = RECORD
  524.         typeDescriptor:            OSType;                                    {  'uf32'  }
  525.         reserved:                UInt32;                                    {  fill with 0x00  }
  526.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size  }
  527.     END;
  528.  
  529.     CMUInt16ArrayTypePtr = ^CMUInt16ArrayType;
  530.     CMUInt16ArrayType = RECORD
  531.         typeDescriptor:            OSType;                                    {  'ui16'  }
  532.         reserved:                UInt32;                                    {  fill with 0x00  }
  533.         value:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  534.     END;
  535.  
  536.     CMUInt32ArrayTypePtr = ^CMUInt32ArrayType;
  537.     CMUInt32ArrayType = RECORD
  538.         typeDescriptor:            OSType;                                    {  'ui32'  }
  539.         reserved:                UInt32;                                    {  fill with 0x00  }
  540.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size  }
  541.     END;
  542.  
  543.     CMUInt64ArrayTypePtr = ^CMUInt64ArrayType;
  544.     CMUInt64ArrayType = RECORD
  545.         typeDescriptor:            OSType;                                    {  'ui64'  }
  546.         reserved:                UInt32;                                    {  fill with 0x00  }
  547.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size (x2)  }
  548.     END;
  549.  
  550.     CMUInt8ArrayTypePtr = ^CMUInt8ArrayType;
  551.     CMUInt8ArrayType = RECORD
  552.         typeDescriptor:            OSType;                                    {  'ui08'  }
  553.         reserved:                UInt32;                                    {  fill with 0x00  }
  554.         value:                    SInt8;                                    {  Variable size  }
  555.     END;
  556.  
  557.     CMViewingConditionsTypePtr = ^CMViewingConditionsType;
  558.     CMViewingConditionsType = RECORD
  559.         typeDescriptor:            OSType;                                    {  'view'  }
  560.         reserved:                UInt32;                                    {  fill with 0x00  }
  561.         illuminant:                CMFixedXYZColor;                        {  absolute XYZs of illuminant  in cd/m^2  }
  562.         surround:                CMFixedXYZColor;                        {  absolute XYZs of surround in cd/m^2  }
  563.         stdIlluminant:            UInt32;                                    {  see definitions of std illuminants  }
  564.     END;
  565.  
  566.     CMXYZTypePtr = ^CMXYZType;
  567.     CMXYZType = RECORD
  568.         typeDescriptor:            OSType;                                    {  'XYZ '  }
  569.         reserved:                UInt32;                                    {  fill with 0x00  }
  570.         XYZ:                    ARRAY [0..0] OF CMFixedXYZColor;        {  variable size XYZ tristimulus values  }
  571.     END;
  572.  
  573. { Profile sequence description type }
  574.     CMProfileSequenceDescTypePtr = ^CMProfileSequenceDescType;
  575.     CMProfileSequenceDescType = RECORD
  576.         typeDescriptor:            OSType;                                    {  'pseq '  }
  577.         reserved:                UInt32;                                    {  fill with 0x00  }
  578.         count:                    UInt32;                                    {  Number of descriptions  }
  579.         data:                    SInt8;                                    {  varaible size data as explained below  }
  580.     END;
  581.  
  582. {
  583.     A variable size array of structs appears as the last block of data
  584.     in the above struct, CMProfileSequenceDescType.  The data structure
  585.     is as follows: (example in C)
  586.     
  587.     struct (                                             
  588.         OSType            deviceMfg;                     * Device Manufacturer 
  589.         OSType            deviceModel;                 * Decvice Model 
  590.         unsigned long    attributes[2];                 * Device attributes 
  591.         OSType            technology;                     * Technology signature 
  592.         unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  593.         unsigned char    mfgDescASCIIName[2];         * Variable size 
  594.         unsigned long    mfgDescUniCodeCode;             
  595.         unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  596.         unsigned char    mfgDescUniCodeName[2];         * Variable size 
  597.         unsigned long    mfgDescScriptCodeCode;         
  598.         unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  599.         unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  600.         unsigned long    modelDescASCIICount;         * the count of "bytes" 
  601.         unsigned char    modelDescASCIIName[2];         * Variable size 
  602.         unsigned long    modelDescUniCodeCode;         
  603.         unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  604.         unsigned char    modelDescUniCodeName[2];     * Variable size 
  605.         short            modelDescScriptCodeCode;     
  606.         unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  607.         SInt8            filler;                         * For proper alignment across languages 
  608.         unsigned char    modelDescScriptCodeName[2];     * Variable size 
  609.     )    profileDescription[1];                         
  610. }
  611.  
  612. { Under color removal, black generation type }
  613.     CMUcrBgTypePtr = ^CMUcrBgType;
  614.     CMUcrBgType = RECORD
  615.         typeDescriptor:            OSType;                                    {  'bfd  '  }
  616.         reserved:                UInt32;                                    {  fill with 0x00  }
  617.         ucrCount:                UInt32;                                    {  Number of UCR entries  }
  618.         ucrValues:                ARRAY [0..0] OF UInt16;                    {  variable size  }
  619.         bgCount:                UInt32;                                    {  Number of BG entries  }
  620.         bgValues:                ARRAY [0..0] OF UInt16;                    {  variable size  }
  621.         ucrbgASCII:                SInt8;                                    {  null terminated ASCII string  }
  622.     END;
  623.  
  624.     CMIntentCRDVMSizePtr = ^CMIntentCRDVMSize;
  625.     CMIntentCRDVMSize = RECORD
  626.         renderingIntent:        LONGINT;                                {  rendering intent  }
  627.         VMSize:                    UInt32;                                    {  VM size taken up by the CRD  }
  628.     END;
  629.  
  630.     CMPS2CRDVMSizeTypePtr = ^CMPS2CRDVMSizeType;
  631.     CMPS2CRDVMSizeType = RECORD
  632.         typeDescriptor:            OSType;                                    {  'psvm'  }
  633.         reserved:                UInt32;                                    {  fill with 0x00  }
  634.         count:                    UInt32;                                    {  number of intent entries  }
  635.         intentCRD:                ARRAY [0..0] OF CMIntentCRDVMSize;        {  variable size  }
  636.     END;
  637.  
  638. { Video Card Gamma type }
  639.  
  640. CONST
  641.     cmVideoCardGammaTableType    = 0;
  642.     cmVideoCardGammaFormulaType    = 1;
  643.  
  644.  
  645.  
  646. TYPE
  647.     CMVideoCardGammaTablePtr = ^CMVideoCardGammaTable;
  648.     CMVideoCardGammaTable = RECORD
  649.         channels:                UInt16;                                    {  # of gamma channels (1 or 3)  }
  650.         entryCount:                UInt16;                                    {  1-based number of entries per channel  }
  651.         entrySize:                UInt16;                                    {  size on bytes of each entry  }
  652.         data:                    SInt8;                                    {  variable size data follows  }
  653.     END;
  654.  
  655.     CMVideoCardGammaFormulaPtr = ^CMVideoCardGammaFormula;
  656.     CMVideoCardGammaFormula = RECORD
  657.         redGamma:                Fixed;                                    {  must be > 0.0  }
  658.         redMin:                    Fixed;                                    {  must be > 0.0 and < 1.0  }
  659.         redMax:                    Fixed;                                    {  must be > 0.0 and < 1.0  }
  660.         greenGamma:                Fixed;                                    {  must be > 0.0  }
  661.         greenMin:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  662.         greenMax:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  663.         blueGamma:                Fixed;                                    {  must be > 0.0  }
  664.         blueMin:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  665.         blueMax:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  666.     END;
  667.  
  668.     CMVideoCardGammaPtr = ^CMVideoCardGamma;
  669.     CMVideoCardGamma = RECORD
  670.         tagType:                UInt32;
  671.         CASE INTEGER OF
  672.         0: (
  673.             table:                CMVideoCardGammaTable;
  674.             );
  675.         1: (
  676.             formula:            CMVideoCardGammaFormula;
  677.             );
  678.     END;
  679.  
  680.     CMVideoCardGammaTypePtr = ^CMVideoCardGammaType;
  681.     CMVideoCardGammaType = RECORD
  682.         typeDescriptor:            OSType;                                    {  'vcgt'  }
  683.         reserved:                UInt32;                                    {  fill with 0x00  }
  684.         gamma:                    CMVideoCardGamma;
  685.     END;
  686.  
  687.     CMMakeAndModelPtr = ^CMMakeAndModel;
  688.     CMMakeAndModel = RECORD
  689.         manufacturer:            OSType;
  690.         model:                    UInt32;
  691.         serialNumber:            UInt32;
  692.         manufactureDate:        UInt32;
  693.         reserved1:                UInt32;                                    {  fill with 0x00  }
  694.         reserved2:                UInt32;                                    {  fill with 0x00  }
  695.         reserved3:                UInt32;                                    {  fill with 0x00  }
  696.         reserved4:                UInt32;                                    {  fill with 0x00  }
  697.     END;
  698.  
  699.     CMMakeAndModelTypePtr = ^CMMakeAndModelType;
  700.     CMMakeAndModelType = RECORD
  701.         typeDescriptor:            OSType;                                    {  'mmod'  }
  702.         reserved:                UInt32;                                    {  fill with 0x00  }
  703.         makeAndModel:            CMMakeAndModel;
  704.     END;
  705.  
  706. {**********************************************************************}
  707. {************** ColorSync 1.0 profile specification *******************}
  708. {**********************************************************************}
  709.  
  710. CONST
  711.     cmGrayResponse                = 0;
  712.     cmRedResponse                = 1;
  713.     cmGreenResponse                = 2;
  714.     cmBlueResponse                = 3;
  715.     cmCyanResponse                = 4;
  716.     cmMagentaResponse            = 5;
  717.     cmYellowResponse            = 6;
  718.     cmUcrResponse                = 7;
  719.     cmBgResponse                = 8;
  720.     cmOnePlusLastResponse        = 9;
  721.  
  722.  
  723. { Device types }
  724.     cmMonitorDevice                = 'mntr';
  725.     cmScannerDevice                = 'scnr';
  726.     cmPrinterDevice                = 'prtr';
  727.  
  728.  
  729.  
  730. TYPE
  731.     CMIStringPtr = ^CMIString;
  732.     CMIString = RECORD
  733.         theScript:                ScriptCode;
  734.         theString:                Str63;
  735.     END;
  736.  
  737. { Profile options }
  738.  
  739. CONST
  740.     cmPerceptualMatch            = $0000;                        {  Default. For photographic images  }
  741.     cmColorimetricMatch            = $0001;                        {  Exact matching when possible  }
  742.     cmSaturationMatch            = $0002;                        {  For solid colors  }
  743.  
  744. { Profile flags }
  745.     cmNativeMatchingPreferred    = $00000001;                    {  Default to native not preferred  }
  746.     cmTurnOffCache                = $00000002;                    {  Default to turn on CMM cache  }
  747.  
  748.  
  749. TYPE
  750.     CMMatchOption                        = LONGINT;
  751.     CMMatchFlag                            = LONGINT;
  752.     CMHeaderPtr = ^CMHeader;
  753.     CMHeader = RECORD
  754.         size:                    UInt32;
  755.         CMMType:                OSType;
  756.         applProfileVersion:        UInt32;
  757.         dataType:                OSType;
  758.         deviceType:                OSType;
  759.         deviceManufacturer:        OSType;
  760.         deviceModel:            UInt32;
  761.         deviceAttributes:        ARRAY [0..1] OF UInt32;
  762.         profileNameOffset:        UInt32;
  763.         customDataOffset:        UInt32;
  764.         flags:                    CMMatchFlag;
  765.         options:                CMMatchOption;
  766.         white:                    CMXYZColor;
  767.         black:                    CMXYZColor;
  768.     END;
  769.  
  770.     CMProfileChromaticitiesPtr = ^CMProfileChromaticities;
  771.     CMProfileChromaticities = RECORD
  772.         red:                    CMXYZColor;
  773.         green:                    CMXYZColor;
  774.         blue:                    CMXYZColor;
  775.         cyan:                    CMXYZColor;
  776.         magenta:                CMXYZColor;
  777.         yellow:                    CMXYZColor;
  778.     END;
  779.  
  780.     CMProfileResponsePtr = ^CMProfileResponse;
  781.     CMProfileResponse = RECORD
  782.         counts:                    ARRAY [0..8] OF UInt16;
  783.         data:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  784.     END;
  785.  
  786.     CMProfilePtr = ^CMProfile;
  787.     CMProfile = RECORD
  788.         header:                    CMHeader;
  789.         profile:                CMProfileChromaticities;
  790.         response:                CMProfileResponse;
  791.         profileName:            CMIString;
  792.         customData:                SInt8;                                    {  Variable size  }
  793.     END;
  794.  
  795.     CMProfileHandle                        = ^CMProfilePtr;
  796. {$IFC OLDROUTINENAMES }
  797.  
  798. CONST
  799.     kCMApplProfileVersion        = $00000100;
  800.  
  801.     grayResponse                = 0;
  802.     redResponse                    = 1;
  803.     greenResponse                = 2;
  804.     blueResponse                = 3;
  805.     cyanResponse                = 4;
  806.     magentaResponse                = 5;
  807.     yellowResponse                = 6;
  808.     ucrResponse                    = 7;
  809.     bgResponse                    = 8;
  810.     onePlusLastResponse            = 9;
  811.  
  812.     rgbData                        = 'RGB ';
  813.     cmykData                    = 'CMYK';
  814.     grayData                    = 'GRAY';
  815.     xyzData                        = 'XYZ ';
  816.  
  817.     monitorDevice                = 'mntr';
  818.     scannerDevice                = 'scnr';
  819.     printerDevice                = 'prtr';
  820.  
  821.  
  822. TYPE
  823.     XYZComponent                        = UInt16;
  824.     XYZColor                            = CMXYZColor;
  825.     XYZColorPtr                         = ^XYZColor;
  826.     CMResponseData                        = UInt16;
  827.     IString                                = CMIString;
  828.     IStringPtr                             = ^IString;
  829.     CMResponseColor                        = LONGINT;
  830.     responseColor                        = CMResponseColor;
  831. {$ENDC}  {OLDROUTINENAMES}
  832.  
  833.  
  834. {$ALIGN RESET}
  835. {$POP}
  836.  
  837. {$SETC UsingIncludes := CMICCProfileIncludes}
  838.  
  839. {$ENDC} {__CMICCPROFILE__}
  840.  
  841. {$IFC NOT UsingIncludes}
  842.  END.
  843. {$ENDC}
  844.